package com.springcloud.tread;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableEurekaClient
@EnableDiscoveryClient//表示用于发现注册中心的微服务
@EnableHystrix//启动熔断器
@EnableCaching//启动缓存
@EnableScheduling//开启定时器
public class StoreSerivceApplication {
    public static void main(String[] args) {
        SpringApplication.run(StoreSerivceApplication.class,args);
    }

    @Bean  //表示让StoreService发现
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }
}
